/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * tampilSQL.java
 *
 * Created on Jun 24, 2014, 10:26:56 AM
 */
package GUI;

import projectkp.DataFile;

/**
 *
 * @author rosi
 */
public class TampilSQL extends javax.swing.JFrame {

    /** Creates new form tampilSQL */
    public TampilSQL() {
        initComponents();
        DataFile data = new DataFile();
        TampilIsiDBF tampilDBF = new TampilIsiDBF();
//        String nama =tampilDBF.file.toString();
//       String nama= 
//        tampilDBF.fileName = data.getNamaFile();
        
//                data.setNamaFile(nama);
//        String namaFile = data.getNamaFile();
        textNamaTabel.setText(tampilDBF.fileName);
        tampilDBF.convert();
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        textNamaTabel = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        textNamaKolom = new javax.swing.JTextArea();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setText("NAMA TABEL     :");

        jLabel2.setText("NAMA KOLOM   :");

        textNamaTabel.setEditable(false);
        textNamaTabel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                textNamaTabelActionPerformed(evt);
            }
        });

        textNamaKolom.setColumns(20);
        textNamaKolom.setEditable(false);
        textNamaKolom.setRows(5);
        jScrollPane1.setViewportView(textNamaKolom);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 417, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(textNamaTabel)))
                .addContainerGap(25, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(textNamaTabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(55, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void textNamaTabelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_textNamaTabelActionPerformed
        // TODO add your handling code here:
//        TampilIsiDBF tampilDBF = new TampilIsiDBF();
//        //        String namaFile = tampilDBF.
//        textNamaTabel.setText("aaaaaaa");
//        //        textNamaKolom.setText(tampilDBF.file.getName());
    }//GEN-LAST:event_textNamaTabelActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                new TampilSQL().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextArea textNamaKolom;
    private javax.swing.JTextField textNamaTabel;
    // End of variables declaration//GEN-END:variables
}
